package dfbz.homework1;
public class Test16 {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3,4,3,2,1};
        int[] arr2 = {1,2,3,4,3,2,1};
        boolean yiZhi= isYiZhi(arr1, arr2);
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i] + " ");
        }
        System.out.println();
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
        System.out.println();
        System.out.println("是否一致: " + yiZhi);
    }

    public static boolean isYiZhi(int[] arr1, int[] arr2)  {
        boolean isYiZhi = true;
        for (int i = 0; i < arr1.length; i++) {
            if (arr1[i] != arr2[i]) {
                isYiZhi=false;
            }else {
                isYiZhi=true;
            }
        }
        return isYiZhi;
    }
}